﻿using System.Windows.Controls;
using System.Windows.Shapes;

namespace ElencySolutions.ImageMap
{
    public static class Extensions
    {

        public static double GetLeft(this Shape shape)
        {
            return (double)shape.GetValue(Canvas.LeftProperty);
        }

        public static double GetTop(this Shape shape)
        {
            return (double)shape.GetValue(Canvas.TopProperty);
        }

        public static void SetLeft(this Shape shape, double left)
        {
            shape.SetValue(Canvas.LeftProperty, left);
        }

        public static void SetTop(this Shape shape, double top)
        {
            shape.SetValue(Canvas.TopProperty, top);
        }

        public static double GetLeft(this Control control)
        {
            return (double)control.GetValue(Canvas.LeftProperty);
        }

        public static double GetTop(this Control control)
        {
            return (double)control.GetValue(Canvas.TopProperty);
        }

        public static void SetLeft(this Control control, double left)
        {
            control.SetValue(Canvas.LeftProperty, left);
        }

        public static void SetTop(this Control control, double top)
        {
            control.SetValue(Canvas.TopProperty, top);
        }

    }
}
